package net.xxcl.zcgl.controller;

import net.xxcl.zcgl.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * User: 夏汛
 * Date: 12-1-15
 * Time: 下午9:02
 */
@Controller
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    private MenuService menuService;

    /**
     * 获取所有菜单
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value="/menus",method= RequestMethod.POST)
    public @ResponseBody
    Map<String,Object> getMenus(HttpServletRequest request,HttpServletResponse response){
        Map<String,Object> responseMap = new HashMap<String, Object>();
        Object t = menuService.getAllMenus();
        responseMap.put("key",t);
        return responseMap;
    }
}
